<%@ page import="com.Cliente" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<g:set var="entityName"
	value="${message(code: 'cliente.label', default: 'Cliente')}" />
<title><g:message code="default.create.label"
		args="[entityName]" />
</title>
</head>
<body>
	<div class="nav">
		<span class="menuButton"><a class="home"
			href="${createLink(uri: '/')}"><g:message
					code="default.home.label" />
		</a>
		</span> <span class="menuButton"><g:link class="list" action="list">
				<g:message code="default.list.label" args="[entityName]" />
			</g:link>
		</span>
	</div>
	<h1 id="pageName">
		Cria
		Cliente
	</h1>

	<g:if test="${flash.message}">
		<div class="message">${flash.message}</div>
	</g:if>
	<g:hasErrors bean="${clienteInstance}">
		<div class="errors">
			<g:renderErrors bean="${clienteInstance}" as="list" />
		</div>
	</g:hasErrors>
	<g:form action="save">
          <fieldset class="tableField">
	  <legend>Cliente:</legend>
			<table class="IadTableForm">
                            <tbody>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="nome"><g:message code="cliente.nome.label" default="Nome" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: clienteInstance, field: 'nome', 'errors')}">
                                    <g:textField name="nome" value="${clienteInstance?.nome}" />
                                </td>
                              
                                <td valign="top" class="name">
                                    <label for="cpf"><g:message code="cliente.cpf.label" default="Cpf / CNPJ" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: clienteInstance, field: 'cpf', 'errors')}">
                                    <g:textField name="cpf" maxlength="11" value="${clienteInstance?.cpf}" />
                                </td>
                            </tr>
                        
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="rua"><g:message code="cliente.rua.label" default="Rua" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: clienteInstance, field: 'rua', 'errors')}">
                                    <g:textField name="rua" value="${clienteInstance?.rua}" />
                                </td>
                                
                                <td valign="top" class="name">
                                    <label for="numero"><g:message code="cliente.numero.label" default="Numero" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: clienteInstance, field: 'numero', 'errors')}">
                                    <g:textField name="numero" value="${clienteInstance?.numero}" />
                                </td>
                            
                                <td valign="top" class="name">
                                    <label for="bairro"><g:message code="cliente.bairro.label" default="Bairro" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: clienteInstance, field: 'bairro', 'errors')}">
                                    <g:textField name="bairro" value="${clienteInstance?.bairro}" />
                                </td>
                                
                                <td valign="top" class="name">
                                    <label for="complemento"><g:message code="cliente.complemento.label" default="Complemento" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: clienteInstance, field: 'complemento', 'errors')}">
                                    <g:textField name="complemento" value="${clienteInstance?.complemento}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="cep"><g:message code="cliente.cep.label" default="Cep" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: clienteInstance, field: 'cep', 'errors')}">
                                    <g:textField name="cep" maxlength="8" value="${clienteInstance?.cep}" />
                                </td>
                          
                                <td valign="top" class="name">
                                    <label for="telefone"><g:message code="cliente.telefone.label" default="Telefone" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: clienteInstance, field: 'telefone', 'errors')}">
                                    <g:textField name="telefone" maxlength="10" value="${clienteInstance?.telefone}" />
                                </td>
                            </tr>        
                            </tbody>
			</table>
          </fieldset>
		</div>
		<div class="buttons">
			<span class="button"><g:submitButton name="create"
					class="save"
					value="${message(code: 'default.button.create.label', default: 'Create')}" />
			</span>
		</div>
	</g:form>
	</div>
</body>
</html>
